<template>
    <div class="OneLockCardItem">
        <el-row>
            <el-col :span="20" :offset="1">
                <div class="text_center width30">
                    <div class="el-form-item-span-wrap">
                        <span class="el-form-item-span-label">账户类别:</span>
                        <span class="el-form-item-span">{{CardSuccessInfo.CATEGORY_filter}}</span>
                    </div>
                </div>
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="20" :offset="1">
                <div class="text_center width30">
                    <div class="el-form-item-span-wrap">
                        <span class="el-form-item-span-label">卡号:</span>
                        <span class="el-form-item-span">{{CardSuccessInfo.body.appBody.CARDNBR}}</span>
                    </div>
                </div>
            </el-col>
        </el-row>
        <el-row>
            <slot name="HintBody"></slot>
        </el-row>
        <el-row>
            <el-col :span="20" :offset="1">
                <div class="text_span text_center">{{titleText}}交易成功！</div>
            </el-col>
        </el-row>
        <div class="text_center margin_top20">
            <el-button
                type="primary"
                size="small"
                @click="handleClose"
                icon="el-icon-circle-check"
                v-preventReClick
            >确定</el-button>
            <el-button type="primary" size="small" @click="handleClickbtn">修改记录查询</el-button>
        </div>
    </div>
</template>

<script>
import { closePage, getBusinessMenuId } from '@/utils/Common';
import { mapState } from 'vuex';
export default {
    name: 'OneLockCardItem',
    props: {
        //成功数据
        CardSuccessInfo: {
            type: Object,
        },
        // 锁卡状态
        lockType: {
            type: String,
            default: '',
        },
    },
    data() {
        return {
            titleText: '',
            MenuId: '',
        };
    },
    computed: mapState({
        businessMenu: state => state.menu.businessMenu,
    }),
    mounted() {
        this.setTextValue();
    },
    methods: {
        setTextValue() {
            switch (this.lockType) {
                case '1':
                    this.titleText = '自定义锁卡';
                    break;
                case '2':
                    this.titleText = '一键全锁';
                    break;
                case '3':
                    this.titleText = '一键全解';
                    break;
                default:
                    break;
            }
        },
        // 点击关闭
        handleClose() {
            closePage(this.$route, this, 1);
        },
        handleClickbtn() {
            this.MenuId = getBusinessMenuId('/businessSystem/accountCardDetaileQuery', this.businessMenu);
            console.log('this.MenuId____', this.MenuId);
            this.$router.push({ name: 'accountCardDetaileQuery', path: '/businessSystem/accountCardDetaileQuery', params: { id: this.MenuId } });
        }
    },
};
</script>
<style lang='scss'>
.OneLockCardItem {
    .text_span {
        margin: 15px 20px;
        font-size: 16px;
    }
    .text_fl {
        margin-bottom: 5px;
    }
    .el-form-item-span-wrap {
        margin-bottom: 10px;
    }
}
</style>
